﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using nERP.Model.Fin;
using nERP.Model;
using nERP.Model.Bas;
using nERP.Model._Admin;

namespace nERP.ViewModel.Fin.OtherOutlayVMs
{
    public partial class OtherOutlayTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._OtherOutlay._OtherOutlayCode")]
        public ExcelPropety OtherOutlayCode_Excel = ExcelPropety.CreateProperty<OtherOutlay>(x => x.OtherOutlayCode);
        [Display(Name = "_Model._OtherOutlay._Supplier")]
        public ExcelPropety Supplier_Excel = ExcelPropety.CreateProperty<OtherOutlay>(x => x.SupplierId);
        [Display(Name = "_Model._OtherOutlay._MakeUser")]
        public ExcelPropety MakeUser_Excel = ExcelPropety.CreateProperty<OtherOutlay>(x => x.MakeUserId);
        [Display(Name = "_Model._OtherOutlay._InvoicesDate")]
        public ExcelPropety InvoicesDate_Excel = ExcelPropety.CreateProperty<OtherOutlay>(x => x.InvoicesDate, true);
        [Display(Name = "_Model._OtherOutlay._SettlementAccount")]
        public ExcelPropety SettlementAccount_Excel = ExcelPropety.CreateProperty<OtherOutlay>(x => x.SettlementAccountId);
        [Display(Name = "_Model._OtherOutlay._OutlayType")]
        public ExcelPropety OutlayType_Excel = ExcelPropety.CreateProperty<OtherOutlay>(x => x.OutlayTypeId);
        [Display(Name = "_Model._OtherOutlay._TotalPrice")]
        public ExcelPropety TotalPrice_Excel = ExcelPropety.CreateProperty<OtherOutlay>(x => x.TotalPrice);
        [Display(Name = "_Model._OtherOutlay._Status")]
        public ExcelPropety Status_Excel = ExcelPropety.CreateProperty<OtherOutlay>(x => x.Status);
        [Display(Name = "_Model._OtherOutlay._Remark")]
        public ExcelPropety Remark_Excel = ExcelPropety.CreateProperty<OtherOutlay>(x => x.Remark);
        //[Display(Name = "_Model._OtherOutlay._CreateTime")]
        //public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<OtherOutlay>(x => x.CreateTime, true);
        //[Display(Name = "_Model._OtherOutlay._UpdateTime")]
        //public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<OtherOutlay>(x => x.UpdateTime, true);
        //[Display(Name = "_Model._OtherOutlay._CreateBy")]
        //public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<OtherOutlay>(x => x.CreateBy);
        //[Display(Name = "_Model._OtherOutlay._UpdateBy")]
        //public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<OtherOutlay>(x => x.UpdateBy);
        //[Display(Name = "_Model._OtherOutlay._IsValid")]
        //public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<OtherOutlay>(x => x.IsValid);
        //[Display(Name = "_Model._OtherOutlay._TenantCode")]
        //public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<OtherOutlay>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            OutlayType_Excel.DataType = ColumnDataType.ComboBox;
            OutlayType_Excel.ListItems = DC.Set<DicField>().Where(x => x.DicDef.DicName == "其他支出类别").OrderBy(x => x.Order).GetSelectListItems(Wtm, y => y.DicFieldDes.ToString(), SortByName: false);

        }

    }

    public class OtherOutlayImportVM : BaseImportVM<OtherOutlayTemplateVM, OtherOutlay>
    {
            //import

    }

}